package com.app.reading;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class Main8Activity extends AppCompatActivity {

    Button btn_login;
    EditText txt_num;
    EditText txt_pwd;
    Button btn_qq;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main8);
        View v=findViewById(R.id.layout);
        v.getBackground().setAlpha(100);
//        ActionBar actionbar =getSupportActionBar();
//        if(actionbar!=null){
//            actionbar.hide();
//        }
        initView();
    }

    private void initView() {
        txt_num=this.findViewById(R.id.txt_num);
        txt_pwd=this.findViewById(R.id.txt_pwd);
        btn_login=this.findViewById(R.id.btn_login);
        btn_qq=this.findViewById(R.id.btn_qq);
        btn_login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                checkAccount();
            }
        });
    }

    private void checkAccount() {
        String number=txt_num.getText().toString();
        String assword=txt_pwd.getText().toString();
        if(number.length()>=6&&number.length()<=18&&assword.length()>=6&&assword.length()<=18){
            Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
            Intent ab=new Intent();
            ab.setClass(Main8Activity.this,Main6Activity.class);
            startActivity(ab);
        }
        else {
            Toast.makeText(this,"格式错误！",Toast.LENGTH_SHORT).show();
        }

    }


}
